package gg.zsw.admin.client;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author zhou.sw
 * @Date 2020/7/23 16:21
 */
@Component
public class Task {

    @Bean("haha")
    public Thread thread1() {
        Runnable target;
        Thread thread = new Thread(() -> {
            for (;;){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("有意思");
            }
        },"haha");
        thread.start();
        return thread;
    }

}
